/*
   Home 主页
*/
import React, { Component } from 'react';
import PropTypes from 'prop-types'; 

class Square extends Component {
    render() {
        return ( <button className = "square" onClick = { this.props.onClick.bind() } > { this.props.value } </button>
        );
    }
}
/*props 默认值以及类型限制  */
Square.defaultProps = {
    value: 123123,
    onClick(){

    }
};

Square.propTypes = {
    value: PropTypes.number,
    onClick:PropTypes.func
};
// optionalArray: PropTypes.array,
// optionalBool: PropTypes.bool,
// optionalFunc: PropTypes.func,
// optionalNumber: PropTypes.number,
// optionalObject: PropTypes.object,
// optionalString: PropTypes.string,
// optionalSymbol: PropTypes.symbol,
export default Square;